OSGEventHandler Class Reference

#include <OSGEventHandler.h>

List of all members.

Public Member Functions

 OSGEventHandler (osg::ref_ptr< osgProducer::Viewer > viewer, CMainFrame *newFrame)
 ~OSGEventHandler ()
bool handle (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &us)
void drawVehicleDodge (const osgGA::GUIEventAdapter &ea)
void drawVehicleSemi (const osgGA::GUIEventAdapter &ea)
void drawSign (const osgGA::GUIEventAdapter &ea)
void drawLight (const osgGA::GUIEventAdapter &ea)
void drawTree (const osgGA::GUIEventAdapter &ea)
void drawBuilding (const osgGA::GUIEventAdapter &ea)
void select (const osgGA::GUIEventAdapter &ea)
void roadPick (const osgGA::GUIEventAdapter &ea)
bool drawRoad (const osgGA::GUIEventAdapter &ea)
bool rightClickMenu (const osgGA::GUIEventAdapter &ea)
void drag (TraffEduObject *dragObject, const osgGA::GUIEventAdapter &ea)
void calculateNewPosition (const osgGA::GUIEventAdapter &ea)
void calculateOldPosition (const osgGA::GUIEventAdapter &ea)

Private Attributes

DrawMode drawMode
osg::ref_ptr< osgProducer::Viewer > _viewer
CMainFrame * frame
TraffEduObject * dragObject
boolean defaultMouse
boolean rightMenu
osg::Vec3 old_position
osg::Vec3 new_position
TraffEduObject * translatedObj


Detailed Description

The OSGEventHandler is the class responsible from the callbacks of OSGWindow, RightView. This class is highly works together with, the classes in GUIEventHandler Module and Rightiew class. For each undoable operation of the user, OSGEventHandler class is responsible to inform of the operation to GUIEventHandler. For RightClick menu operations it informs the RightView class to pop up the appropriate rigth click menu. (ie. if right-click on an object, ObjectMenu; if on an empty place, FreeMenu, is popped-up.) Main user operations OSGEventHandler class deals are as follows; 1. Creation of any object to any place. 2. Drag & Drop operations of any object. 3. Selection and Deselection of any object, and multiple objects. 4. Poping Up suitable RigthClick Menus.


Constructor & Destructor Documentation

OSGEventHandler::OSGEventHandler (  osg::ref_ptr< osgProducer::Viewer >  viewer,
CMainFrame *  newFrame
)  [inline]
 

Constructor for the OSGEventHandler class.

Parameters:
viewer under which viewer the OSGEventHandler works.
newFrame under which CMainFrame the OSGEventHandler works.

OSGEventHandler::~OSGEventHandler (   )  [inline]
 

Destructor for the OSGEventHandler class.


Member Function Documentation

void OSGEventHandler::calculateNewPosition (  const osgGA::GUIEventAdapter &  ea  ) 
 

Responsible from the execute/undo opearion of a translate.

Parameters:
ea a variable of type osgGA::GUIEventAdapter&

void OSGEventHandler::calculateOldPosition (  const osgGA::GUIEventAdapter &  ea  ) 
 

Responsibe from the execute/undo opearion of a translate.

Parameters:
ea a variable of type osgGA::GUIEventAdapter&

void OSGEventHandler::drag (  TraffEduObject *  dragObject,
const osgGA::GUIEventAdapter &  ea
) 
 

Drags the selected object.

Parameters:
dragObject object in drag mode
ea a variable of type osgGA::GUIEventAdapter&, to get from which points the object will pass through.

void OSGEventHandler::drawBuilding (  const osgGA::GUIEventAdapter &  ea  ) 
 

Draws the Environmental Object Building.

Parameters:
ea a variable of type osgGA::GUIEventAdapter&, to get where to create the building.

void OSGEventHandler::drawLight (  const osgGA::GUIEventAdapter &  ea  ) 
 

Draws the Traffic Light.

Parameters:
ea a variable of type osgGA::GUIEventAdapter&, to get where to create the light.

bool OSGEventHandler::drawRoad (  const osgGA::GUIEventAdapter &  ea  ) 
 

Draws the Road, in association with the roadPick.

Parameters:
ea a variable of type osgGA::GUIEventAdapter&, to get from which points the road will pass through.

void OSGEventHandler::drawSign (  const osgGA::GUIEventAdapter &  ea  ) 
 

Draws the Traffic Sign.

Parameters:
ea a variable of type osgGA::GUIEventAdapter&, to get where to create the sign.

void OSGEventHandler::drawTree (  const osgGA::GUIEventAdapter &  ea  ) 
 

Draws the Environmental Object Tree.

Parameters:
ea a variable of type osgGA::GUIEventAdapter&, to get where to create the tree.

void OSGEventHandler::drawVehicleDodge (  const osgGA::GUIEventAdapter &  ea  ) 
 

Draws the Vehicle Dodge.

Parameters:
ea a variable of type osgGA::GUIEventAdapter&, to get where to create the vehicle.

void OSGEventHandler::drawVehicleSemi (  const osgGA::GUIEventAdapter &  ea  ) 
 

Draws the Vehicle Semi.

Parameters:
ea a variable of type osgGA::GUIEventAdapter&, to get where to create the vehicle.

bool OSGEventHandler::handle (  const osgGA::GUIEventAdapter &  ea,
osgGA::GUIActionAdapter &  us
) 
 

Main function in the OSGEventHandler class to deal with the users mouse and Keyboard actions.

Parameters:
ea a variable of type osgGA::GUIEventAdapter& telling which action occured.
us osgGA::GUIActionAdapter&
Returns:
operation success.

bool OSGEventHandler::rightClickMenu (  const osgGA::GUIEventAdapter &  ea  ) 
 

Pops-up rightClick menus.

Parameters:
ea a variable of type osgGA::GUIEventAdapter&, to get where to pop-up the right-click menu.

void OSGEventHandler::roadPick (  const osgGA::GUIEventAdapter &  ea  ) 
 

Gets the Road control points.

Parameters:
ea a variable of type osgGA::GUIEventAdapter&, to get from which points the road will pass through.

void OSGEventHandler::select (  const osgGA::GUIEventAdapter &  ea  ) 
 

Selects (ie. highlights) object..

Parameters:
ea a variable of type osgGA::GUIEventAdapter&, to get where an action of selection occured.


Member Data Documentation

osg::ref_ptr<osgProducer::Viewer> OSGEventHandler::_viewer [private]
 

boolean OSGEventHandler::defaultMouse [private]
 

TraffEduObject* OSGEventHandler::dragObject [private]
 

DrawMode OSGEventHandler::drawMode [private]
 

CMainFrame* OSGEventHandler::frame [private]
 

osg::Vec3 OSGEventHandler::new_position [private]
 

osg::Vec3 OSGEventHandler::old_position [private]
 

boolean OSGEventHandler::rightMenu [private]
 

TraffEduObject* OSGEventHandler::translatedObj [private]
 


The documentation for this class was generated from the following file:
Generated on Sun May 28 18:44:00 2006 by  doxygen 1.4.6-NO